package Test.Thread;

import java.util.HashMap;

public class internnTest {
    public static void main(String[] args) {
        String s1 = "123a";
        String s2 = new String("123a");
        System.out.println(s1==s2);
        System.out.println(s1 == s2.intern());
        String s3 = new StringBuilder("aa").append("va").toString();
        System.out.println(s3.intern()==s3);
        String s4 = "java";
        System.out.println(s4.intern() == s4);
        String s5 = new String("java");
        System.out.println(s5.intern()==s5);
        Long a = Long.valueOf(2);
        Long c = Long.valueOf(2);
        long b = 2;
        System.out.println(a==b);
        System.out.println(a.equals(b));
        System.out.println(a.equals(c));
    }
}
